import { Component } from 'react';
import { Link } from 'umi';
import { ITagDetail } from '@/types';
import styles from './index.less';
import {
  EyeOutlined,
  ShareAltOutlined,
  HeartOutlined,
} from '@ant-design/icons';
import { formatDate } from '@/utils';
interface Props {
  item: Partial<ITagDetail>;
}
export default class tagfoot extends Component<Props> {
  state = {};

  render() {
    const { item } = this.props;
    console.log(item);
    
    return (
      <dl>
        <Link to={`/article/${item.id}`}>
          <dt>
            <b>{item.title}</b>
            <span className={styles.exp}>{formatDate(item.updateAt!)}</span>
          </dt>
          <dd>
            {item.cover? <div className={styles.dl_left}>
              <img src={item.cover} alt="" />
              
            </div>:''}
            <div className={styles.dl_right}>
              <p>{item.summary}</p>
              <div className={styles.icons}>
                <EyeOutlined />
                <span>{item.likes}</span>
                <span>·</span>
                <HeartOutlined />
                <span>{item.views}</span>
                <span>·</span>
                <ShareAltOutlined />
                <span>分享</span>
              </div>
            </div>
          </dd>
        </Link>
      </dl>
    );
  }
}
